package com.xgd.phylw.controller;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.NoHandlerFoundException;


@ControllerAdvice
public class CustomExceptionResolver{

    @ExceptionHandler(NoHandlerFoundException.class)
    public ModelAndView handlerException(NoHandlerFoundException e,ModelAndView mv){
        mv.setViewName("error");
        return mv;
    }
}
